# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=basu
pkgver=0.2.0
pkgrel=2
pkgdesc="The sd-bus library, extracted from systemd"
url="https://sr.ht/~emersion/basu/"
license="LGPL-2.1-or-later"
arch="all"
makedepends="audit-dev gperf libcap-dev meson"
subpackages="$pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~emersion/basu/archive/v$pkgver.tar.gz
	allow-both-shared-and-static-lib.patch
	link-basuctl-with-libbasu-dynamically.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	abuild-meson \
		-Dsystem-bus-address="unix:path=/run/dbus/system_bus_socket" \
		-Ddefault_library=both \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
c9ccb1aff4522752b06c14b49508513cf3d3295559160ac6278ca3140049ea9e4ba89394ef2837e5d8150f31431b50237480fbc71e0a70f1c0155d2419a2853b  basu-0.2.0.tar.gz
ce3edb36ec08012deeab1616a1df20f0bcbb7157a0b544b188ee1ccbe0f2cbcff8dd23b7f36bc1f75c993ff8409bd57d9bbe3bde1f4ba575b669bbe085f97cb3  allow-both-shared-and-static-lib.patch
172c6e519fcee29edff010423487a93f4e7e144836bf0d1e92181b5518e6a1c4e477f5d971e7cf93314b69d33674a5ae69cd963f0dd876496c34dd1fb0047020  link-basuctl-with-libbasu-dynamically.patch
"
